package com.qf.common.feigns;

import com.qf.common.bean.R;
import com.qf.common.model.QfDevice;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.concurrent.ExecutionException;

@FeignClient(value = "qf-center-service")
public interface DeviceApi {
    @GetMapping("/api/device/count/{tenantId}/{deleted}")
    public R count(@PathVariable("tenantId") Long tenantId, @PathVariable("deleted") int deleted);

    @GetMapping("/api/device/listByTenant/{tenantId}")
    R listByTenant(@PathVariable("tenantId") Long tenantId) throws ExecutionException, InterruptedException;

    @GetMapping("/api/device/get/{deviceId}")
    R get(@PathVariable("deviceId") Long deviceId);

    @GetMapping("/api/device/getTenantIdByDeviceKey/{deviceKey}")
    String getTenantIdByDeviceKey(@PathVariable("deviceKey") String deviceKey);

    @GetMapping("/api/device/getProductKeyByDeviceKey/{deviceKey}")
    String getProductKeyByDeviceKey(@PathVariable("deviceKey")String deviceKey);

    @GetMapping("/api/device/findByDeviceKey/{deviceKey}")
    QfDevice findByDeviceKey(@PathVariable("deviceKey") String deviceKey);
}
